package cn.dakaqi.pingan.services;

import cn.dakaqi.entities.PinganOpen;
import cn.dakaqi.utils.exception.ServiceRuntimeException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author chunyang on 2016/4/19.
 */
@Component(value = "pinganOpenService")
@Transactional
public class PinganOpenServiceImpl implements PinganOpenService
{
    @Autowired
    PinganOpenDao pinganOpenDao;
    @Override
    public PinganOpen save(PinganOpen pinganOpenRecord) throws ServiceRuntimeException
    {
        return pinganOpenDao.save(pinganOpenRecord);
    }

    @Override
    public PinganOpen findByMobileAndIdCard(String mobile, String idCard) throws ServiceRuntimeException
    {
        return pinganOpenDao.findByMobileAndIdCard(mobile,idCard);
    }

    @Override
    public PinganOpen findByIdCard(String idCard) {
        return pinganOpenDao.findByIdCard(idCard);
    }

    @Override
    public PinganOpen findByCardNum(String cardNum) throws ServiceRuntimeException
    {
        return pinganOpenDao.findByCardNum(cardNum);
    }

    @Override
    public PinganOpen findByVolunteerCode(String volunteerCode)
    {
        return pinganOpenDao.findByVolunteerCode(volunteerCode);
    }

    @Override
    public PinganOpen findByCardNumAndStatus(String cardNum, int statusNo)
    {
        return pinganOpenDao.findByCardNumAndStatus(cardNum,statusNo);
    }

    @Override
    public PinganOpen findByVolunteerCodeAndStatus(String volunteerCode, int statusYes)
    {
        return pinganOpenDao.findByVolunteerCodeAndStatus(volunteerCode,statusYes);
    }
}
